// TypeScript file
/**
 * 玩法
 */
class playmethod extends eui.Component {
  private guize: eui.Group;//规则说明
  private daoju: eui.Group;//道具说明
  private closebtn: eui.Image;//关闭按钮

  private gui_ze: eui.Label;//规则说明触发按钮
  private dao_ju: eui.Label;//道具说明触发按钮


  public constructor() {
    super();
    this.skinName = "resource/assets/skins/WanFa.exml";//玩法界面
    this.create();
    st_config.setScreenAuto(this);
  }

  public create() {
    this.gui_ze.textColor = 0x8aff00;

    //this.gui_ze.touchEnabled=true;
    //添加触发事件
    this.gui_ze.addEventListener(egret.TouchEvent.TOUCH_TAP, this.guizevent, this);

    //this.dao_ju.touchEnabled=true;
    this.dao_ju.addEventListener(egret.TouchEvent.TOUCH_TAP, this.daojuevent, this);

    this.closebtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.closeBtn, this);


  }
  //规则方法，显示规则，隐藏说明
  private guizevent(e: egret.TouchEvent) {
    SoundManager.getInstance().playEffectSound("click_mp3");
    this.guize.visible = true;
    this.daoju.visible = false;
    this.gui_ze.textColor = 0x8aff00;
    this.dao_ju.textColor = 0xFFFFFF;
  }

  private daojuevent(e: egret.TouchEvent) {
    SoundManager.getInstance().playEffectSound("click_mp3");
    this.guize.visible = false;
    this.daoju.visible = true;
    this.gui_ze.textColor = 0xFFFFFF;
    this.dao_ju.textColor = 0x8aff00;

  }
  private closeBtn(e: egret.TouchEvent) {
    SoundManager.getInstance().playEffectSound("click_mp3");
    this.parent.removeChild(this);
  }


}